import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import reducer from './reducer';
import {createStore} from 'redux'

const store = createStore(reducer);
const render =() => ReactDOM.render(
  <App value={store.getState()}
    onInc={() => store.dispatch({ type: 'INC' })}
    onDec={() => store.dispatch({ type: 'DEC' })}/>,
  document.getElementById('root')
);
render();
store.subscribe(render);
